require('async-to-gen/register')
var fs = require('fs')
var FetchImgs = require('./fetch-imgs')

var argv = process.argv
var url = argv[2]
var selector = argv[3] || 'figure>a>img'
var folderName = argv[4] || 'xinggan' //Math.random().toString(36).substr(2, 8)
var attr = argv[5] || 'data-url'
var cateSelector = argv[6] || '#st_1'
var linkSelector = argv[7] || '#waterfall > li.box'
var imgAttr = argv[8] || 'data-src'
var directory = `./imgs/${folderName}`

FetchImgs.my(url, selector, folderName, attr, cateSelector, linkSelector, imgAttr, directory).catch(error => console.error(error)) 

//制服
//node mm-eastday http://mm.eastday.com 'figure>a>img' zhifu 'data-url' '#st_3'
//气质 
//node mm-eastday http://mm.eastday.com 'figure>a>img' qizhi 'data-url' '#st_0' 
//
//美腿
//node mm-eastday http://mm.eastday.com 'figure>a>img' meitui 'data-url' '#st_2' 
//嫩模
//node mm-eastday http://mm.eastday.com 'figure>a>img' nengmo 'data-url' '#st_4'
//丝袜
//node mm-eastday http://mm.eastday.com 'figure>a>img' siwa 'data-url' '#st_5' 
//古典
//node mm-eastday http://mm.eastday.com 'figure>a>img' gudian 'data-url' '#st_6'